package com.ai.pos.server.database;



import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;



public class Connector {


	public Connection getConnection() {

	            Connection conn     = null;
	            String url          = "jdbc:mysql://localhost:3306/";
	            String db           = "pos";
	            String driver       = "com.mysql.jdbc.Driver";
	            String user         = "aiPosUser";
	            String pass         = "Camb0dia";
	                
	        try {
	                Class.forName(driver).newInstance();
	        } catch (InstantiationException e) {
	                e.printStackTrace();
	        } catch (IllegalAccessException e) {
	                e.printStackTrace();
	        } catch (ClassNotFoundException e) {
	                e.printStackTrace();
	        }
	        try {
	                        
	                        conn =  DriverManager.getConnection(url+db, user, pass);
	        } catch (SQLException e) {
	                        System.err.println("Mysql Connection Error: ");
	                e.printStackTrace();
	        }
	                return conn;
	}
	
	
	
	
}
